const http = require("http");
const url = require("url");
const querystring = require('querystring')
const application = http.createServer();
application.on("request", (request, response) => {
    let postParams = "";
    request.on("data", (data) => {
        postParams += data;
    });
    request.on("end", () => {
        // 这是一个字符串
        // console.log(postParams);
        // 把POST请求的字符串转化为对象，有利于后续的操作
        console.log(querystring.parse(postParams));
    });
    // 必须写，否则服务器一直不会响应！
    response.end('服务器响应成功！')
});
application.listen(3007);
console.log("post服务器启动成功！请访问：http://localhost:3007");
